package com.uzai.console.mapper;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.uzai.console.dto.uzaichat.kefuclient.KefuClientQuery;
import com.uzai.console.entity.KefuClient;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

@Repository
public interface KefuClientMapper {
    int deleteById(@Param("id") Long id, @Param("merId") Long merId);

    int deleteByKefuUserId(@Param("kefuUserId") Long  kefuUserId, @Param("merId") Long merId);

    int deleteByDeviceUniqueId(@Param("deviceUniqueId") Long deviceUniqueId, @Param("merId") Long merId);

    int insert(KefuClient record);

    int insertSelective(KefuClient record);

    KefuClient selectById(@Param("id") Long id, @Param("merId") Long merId);

    int updateByIdSelective(KefuClient record);

    int updateById(KefuClient record);

    /**
     * 分页查询
     * @param page
     * @param query
     * @return
     */
    ArrayList<KefuClient> findByList(Page<KefuClient> page, @Param("query") KefuClientQuery query);

    /**
     * 查询所有
     * @param query
     * @return
     */
    ArrayList<KefuClient> findByList(@Param("query") KefuClientQuery query);

}